<template>
  <!-- <h2>home路由组件</h2> -->
  <div>
    <TypeNav></TypeNav>
    <!-- 列表组件 -->
    <List></List>
    <!-- 今日推荐组件 -->
    <Recommend></Recommend>
    <!-- 热卖排行组件 -->
    <Rank> </Rank>
    <!-- 猜你喜欢组件 -->
    <Like></Like>
    <!-- 楼层组件 -->
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"></Floor>
    <!-- 商标组件 -->
    <Brand></Brand>
  </div>
</template>

<script>
// 引入各个组件
import List from './list/List.vue';
import Recommend from './recommend/Recommend.vue';
import Rank from './rank/Rank.vue';
import Like from './like/Like.vue';
import Floor from './floor/Floor.vue';
import Brand from './brand/Brand.vue';
import { mapState } from 'vuex';
export default {
  name: 'Home',
  components: { List, Recommend, Rank, Like, Floor, Brand },
  computed: {
    ...mapState({
      floorList: state => state.Home.floorArr
    })
  },
  mounted() {
    // 通知vuex发请求
    this.$store.dispatch('getfloor')
  },
};

</script>

<style scoped></style>